package com.csnf.mapper;

import com.csnf.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    //注册功能
    @Insert("insert into user (user_name,password,create_time) " +
            " values (#{userName},#{pwd},now())")
    public Integer register(@Param("userName") String userName,@Param("pwd") String pwd);


    //检查用户名是否已经存在

    @Select("select * from user where user_name = #{userName}")
    public User findUserByName(@Param("userName") String userName);

}
